#!/usr/bin/python

class Person:
	size = 0 # class field
	# all method in class take first arg(called self)
	# python will set this value
	
	# constructor
	def __init__(self,name):
		self.name = name # instance field
		Person.size += 1

	def sayHi(self):
		print 'hi,'+self.name

	# destructor
	def __del__(self):
		print 'bye,'+self.name
		Person.size -= 1

	def howMany(self):
		'''Prints the current size'''
		print 'size=',Person.size


def sayHi(name):
	print 'hi,name='+name

p1 = Person('wzq')
print p1.sayHi()
p1.howMany()
sayHi(p1.name)


